import { BaseSpriteToolTip } from "../../common/tooltip/BaseSpriteToolTip";
import { ObjCreate } from "../../common/ObjCreate";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { ImagesConst } from "../../../resource/ImagesConst";
import { AutoFeedCheckBoxSprite } from "../../autoFeed/AutoFeedCheckBoxSprite";
import { Language } from "../../../../../extend/language/Language";
import { GameDefConfig } from "../../../resource/GameDefConfig";
import { WardrobeConfig } from "../../../resource/WardrobeConfig";
//class FashionJewelAttriItemToolTips
    
    export  class FashionJewelAttriItemToolTips extends BaseSpriteToolTip
    {
        constructor()
        {
            super();
            this.initView();
            return;
        }

        /* internal  */initView(): void
        {
            this._attTitle = ObjCreate.createGTextField("", 38, 2, 68, 20, this, GlobalStyle.textFormat2);
            this._lvTx = ObjCreate.createGTextField("", 8, 22, 120, 20, this, GlobalStyle.textFormat10);
            this._attUpTx = ObjCreate.createGTextField("", 8, 42, 120, 20, this, GlobalStyle.textFormat10);
            ObjCreate.createBg(10, 63, 120, 1, this, ImagesConst.SeptalLine);
            this._colorSp = new AutoFeedCheckBoxSprite();
            this._colorSp.x = 0;
            this._colorSp.y = 64;
            addChild(this._colorSp);
            this._nextTx = ObjCreate.createGTextField(Language.getString(79024), 8, 1, 60, 20, this._colorSp, GlobalStyle._textFormat3);
            this._attDownTx = ObjCreate.createGTextField(Language.getString(79024), 8, 20, 120, 20, this._colorSp, GlobalStyle._textFormat3);
            return;
        }

        public /* override */ set tooltipData(arg1)
        {
            var loc1=null;
            super.tooltipData = arg1 as Object;
            if (arg1) 
            {
                loc1 = GameDefConfig.instance.getEJewel(arg1.attri).text1;
                this._attTitle.text = loc1 + Language.getString(74602);
                this._lvTx.text = Language.getString(90113) + "  " + Language.getStringByParam(73021, arg1.lv);
                if (arg1.lv >= WardrobeConfig.instance.fashionJewelMaxLv) 
                {
                    this._attUpTx.text = Language.getString(70144) + "  " + loc1 + "+" + WardrobeConfig.instance.getfashionJewelAttriByLvDic(WardrobeConfig.instance.fashionJewelMaxLv, arg1.attri);
                    this._colorSp.visible = false;
                    this._colorSp.y = 0;
                }
                else 
                {
                    this._attUpTx.text = Language.getString(70144) + "  " + loc1 + "+" + WardrobeConfig.instance.getfashionJewelAttriByLvDic(arg1.lv, arg1.attri);
                    this._attDownTx.text = Language.getString(70144) + "  " + loc1 + "+" + WardrobeConfig.instance.getfashionJewelAttriByLvDic(arg1.lv + 1, arg1.attri);
                    this._colorSp.visible = true;
                    this._colorSp.y = 64;
                }
            }
            return;
        }

        /* internal */ /* var */_attTitle: Object /* flash.text.TextField */;

        /* internal */ /* var */_lvTx: Object /* flash.text.TextField */;

        /* internal */ /* var */_attUpTx: Object /* flash.text.TextField */;

        /* internal */ /* var */_nextTx: Object /* flash.text.TextField */;

        /* internal */ /* var */_attDownTx: Object /* flash.text.TextField */;

        /* internal */ /* var */_colorSp: AutoFeedCheckBoxSprite;
    }
